<?

//Initiate Authenticate
SecurityRedirect ();

//initiate Vars 
define("PRIMARY_KEY","nobkt");
$PRIMARY_KEY    = PRIMARY_KEY;
$PRIMARY_VALUE  = GetParam($PRIMARY_KEY,"");
$FileName       = "ais_transaction_dn.php";
$FileTemplate   = "ais_transaction_dn_print.html";
$SubHeaderTitle = "Transaction Advance - Entry Advance - Report";
$TableName		= "ais_memorial";
$HTMLFormName   = "AdvanceForm";
$MaxGrid        = "50";

$FormAction    = $FileName . "?" . AddParam(GetQueryString("QueryString", ""),"form","$HTMLFormName");
$FormEncType   = "application/x-www-form-urlencoded";

//******* SHOW FORM CONTENT *********
$TBS = new clsTinyButStrong ;
$TBS->LoadTemplate($MOD_TEMPLATE_DIR."/".$FileTemplate);

//********************************* HTML Header ******************************************
$CompanyName = GetCompanyName();
$CompanyAddress = GetCompanyAddress();

$SQL = "SELECT * FROM $TableName WHERE nobkt='".GetParam("nobkt","")."' AND ktrasl='".GetOfficeID()."' ";
$TBS->MergeBlock("headblv",$DBMysql,$SQL);
$SQLTotal = "SELECT sum(jumlah) FROM $TableName WHERE nobkt='".GetParam("nobkt","")."' AND ktrasl='".GetOfficeID()."' ";
$total_trans = $DBConnection->dbc->get_var($SQLTotal);

$OFFICE_STRING = GetOfficeID()." - ".GetBranchName ();

$cc = new intToRupiah;
$GetCurrency = $DBConnection->dbc->get_var("SELECT DISTINCT tunam FROM tblcurrency, ais_advance WHERE ais_advance.nobkt='".GetParam("nobkt","")."' AND tblcurrency.tucode=ais_advance.curr AND ktrasl='".GetOfficeID()."'");
//$DBConnection->dbc->debug();
$cc->setTail($GetCurrency);
$cc->setNumber($total_trans);
$SpellNumber = ucfirst(strtoupper(trim($cc->currency)));

//********************************* HTML GRID *********************************************
$TBS->MergeBlock("blg",$DBMysql,$SQL);
$TBS->Show();

?>